package com.anXin.apis.equipment.fallback;


import com.anXin.apis.article.IArticleClient;
import com.anXin.apis.equipment.IEquipmentClient;
import com.anXin.model.article.dtos.ArticleDto;
import com.anXin.model.common.dtos.ResponseResult;
import com.anXin.model.common.enums.AppHttpCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class IEquipmentClientFallback implements IEquipmentClient {

    @Override
    public ResponseResult getEquipment() {
        log.error("获取设备触发熔断");
//        throw new RuntimeException();
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取设备数据失败!当前人数过多请稍后重试");
    }

    @Override
    public ResponseResult getRateZones(String date) {
        log.error("获取心率触发熔断");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取心率数据失败!当前人数过多请稍后重试");
    }

    @Override
    public ResponseResult getBMI(String date) {
        log.error("获取BMI触发熔断");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取BMI数据失败!当前人数过多请稍后重试");
    }

    @Override
    public ResponseResult getWeight(String date) {
        log.error("获取体重触发熔断");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取体重数据失败!当前人数过多请稍后重试");
    }

    @Override
    public ResponseResult getCalories(String date) {
        log.error("获取卡路里触发熔断");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取卡路里数据失败!当前人数过多请稍后重试");
    }

    @Override
    public ResponseResult getFloors(String date) {
        log.error("获取楼层触发熔断");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取楼层数据失败!当前人数过多请稍后重试");
    }

    @Override
    public ResponseResult getSteps(String date) {
        log.error("获取步数触发熔断");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取步数数据失败!当前人数过多请稍后重试");
    }

    @Override
    public ResponseResult getDistance(String date) {
        log.error("获取距离触发熔断");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取距离数据失败!当前人数过多请稍后重试");
    }

    @Override
    public ResponseResult getElevation(String date) {
        log.error("获取海拔触发熔断");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取海拔数据失败!当前人数过多请稍后重试");
    }
}
